package com.ninong.ker.common.tools;

/**
 * @author jmz
 */
public class SystemConstant {
    /**
     * 租户根节点id
     */
    public static final String ROOT_PARENT_ID = "system";

    public static final String INIT_SQL = "";
    public static final String INIT_SQL_DEPT = "CREATE TABLE `fw_dept`  (\n" +
            "  `id` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'ID',\n" +
            "  `pid` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '上级部门',\n" +
            "  `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '名称',\n" +
            "  `create_time` datetime(0) NOT NULL COMMENT '创建日期',\n" +
            "  `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',\n" +
            "  `tenant_id` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '租户id',\n" +
            "  PRIMARY KEY (`id`) USING BTREE,\n" +
            "  INDEX `inx_pid`(`pid`) USING BTREE\n" +
            ") ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '部门' ROW_FORMAT = COMPACT";
    public static final String INIT_SQL_DIC = "CREATE TABLE `fw_dic`  (\n" +
            "  `id` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'ID',\n" +
            "  `code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '字典编码',\n" +
            "  `value` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '字典值',\n" +
            "  `description` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '描述',\n" +
            "  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期',\n" +
            "  `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',\n" +
            "  `tenant_id` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '租户id',\n" +
            "  PRIMARY KEY (`id`) USING BTREE\n" +
            ") ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '数据字典' ROW_FORMAT = COMPACT";
    public static final String INIT_SQL_DIC_DETAIL = "CREATE TABLE `fw_dic_detail`  (\n" +
            "  `id` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'ID',\n" +
            "  `dic_id` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '字典id',\n" +
            "  `code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '字典编码',\n" +
            "  `value` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '字典值',\n" +
            "  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期',\n" +
            "  `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',\n" +
            "  `tenant_id` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '租户id',\n" +
            "  PRIMARY KEY (`id`) USING BTREE,\n" +
            "  INDEX `FK5tpkputc6d9nboxojdbgnpmyb`(`dic_id`) USING BTREE\n" +
            ") ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '数据字典详情' ROW_FORMAT = COMPACT";
    public static final String INIT_SQL_LOG = "CREATE TABLE `fw_log`  (\n" +
            "  `id` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'ID',\n" +
            "  `description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,\n" +
            "  `log_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'INFO  ERROR',\n" +
            "  `method` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,\n" +
            "  `params` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL,\n" +
            "  `request_ip` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,\n" +
            "  `time` bigint NULL DEFAULT NULL,\n" +
            "  `username` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,\n" +
            "  `browser` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,\n" +
            "  `exception_detail` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL,\n" +
            "  `create_time` datetime(0) NULL DEFAULT NULL,\n" +
            "  `tenant_id` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '租户id',\n" +
            "  PRIMARY KEY (`id`) USING BTREE,\n" +
            "  INDEX `log_create_time_index`(`create_time`) USING BTREE,\n" +
            "  INDEX `inx_log_type`(`log_type`) USING BTREE\n" +
            ") ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统日志' ROW_FORMAT = COMPACT";
    public static final String INIT_SQL_MENU = "CREATE TABLE `fw_menu`  (\n" +
            "  `id` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'ID',\n" +
            "  `pid` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '上级菜单ID',\n" +
            "  `type` char(8) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '菜单类型',\n" +
            "  `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '菜单标题',\n" +
            "  `sort` int NULL DEFAULT NULL COMMENT '排序',\n" +
            "  `icon` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图标',\n" +
            "  `permission` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '权限',\n" +
            "  `param` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '参数',\n" +
            "  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期',\n" +
            "  `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',\n" +
            "  `path` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '链接地址',\n" +
            "  `component` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '组件路由',\n" +
            "  `form_code` varchar(225) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,\n" +
            "  `data_id` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,\n" +
            "  `task_key` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,\n" +
            "  PRIMARY KEY (`id`) USING BTREE,\n" +
            "  INDEX `inx_pid`(`pid`) USING BTREE,\n" +
            "  INDEX `uniq_title`(`name`) USING BTREE\n" +
            ") ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统菜单' ROW_FORMAT = COMPACT";
    public static final String INIT_SQL_QUARTZ_JOB = "CREATE TABLE `fw_quartz_job`  (\n" +
            "  `id` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'ID',\n" +
            "  `bean_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Spring Bean名称',\n" +
            "  `cron_expression` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'cron 表达式',\n" +
            "  `is_pause` bit(1) NULL DEFAULT NULL COMMENT '状态：1暂停、0启用',\n" +
            "  `job_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '任务名称',\n" +
            "  `method_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '方法名称',\n" +
            "  `params` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '参数',\n" +
            "  `description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',\n" +
            "  `person_in_charge` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '负责人',\n" +
            "  `email` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '报警邮箱',\n" +
            "  `sub_task` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '子任务ID',\n" +
            "  `pause_after_failure` bit(1) NULL DEFAULT NULL COMMENT '任务失败后是否暂停',\n" +
            "  `create_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建者',\n" +
            "  `update_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新者',\n" +
            "  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期',\n" +
            "  `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',\n" +
            "  PRIMARY KEY (`id`) USING BTREE,\n" +
            "  INDEX `inx_is_pause`(`is_pause`) USING BTREE\n" +
            ") ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '定时任务' ROW_FORMAT = COMPACT";
    public static final String INIT_SQL_QUARTZ_LOG = "CREATE TABLE `fw_quartz_log`  (\n" +
            "  `id` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'ID',\n" +
            "  `bean_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,\n" +
            "  `create_time` datetime(0) NULL DEFAULT NULL,\n" +
            "  `cron_expression` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,\n" +
            "  `exception_detail` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL,\n" +
            "  `is_success` bit(1) NULL DEFAULT NULL,\n" +
            "  `job_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,\n" +
            "  `method_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,\n" +
            "  `params` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,\n" +
            "  `time` bigint NULL DEFAULT NULL,\n" +
            "  `tenant_id` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '租户id',\n" +
            "  PRIMARY KEY (`id`) USING BTREE\n" +
            ") ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '定时任务日志' ROW_FORMAT = COMPACT";
    public static final String INIT_SQL_ROLE = "CREATE TABLE `fw_role`  (\n" +
            "  `id` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'ID',\n" +
            "  `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '名称',\n" +
            "  `description` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '描述',\n" +
            "  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期',\n" +
            "  `tenant_id` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '租户id',\n" +
            "  PRIMARY KEY (`id`) USING BTREE\n" +
            ") ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色表' ROW_FORMAT = COMPACT";
    public static final String INIT_SQL_ROLES_MENU = "CREATE TABLE `fw_roles_menus`  (\n" +
            "  `menu_id` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '菜单ID',\n" +
            "  `role_id` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '角色ID',\n" +
            "  PRIMARY KEY (`menu_id`, `role_id`) USING BTREE,\n" +
            "  INDEX `FKcngg2qadojhi3a651a5adkvbq`(`role_id`) USING BTREE\n" +
            ") ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色菜单关联' ROW_FORMAT = COMPACT";
    public static final String INIT_SQL_STORAGE = "CREATE TABLE `fw_storage`  (\n" +
            "  `id` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'ID',\n" +
            "  `real_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件真实的名称',\n" +
            "  `suffix` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '后缀',\n" +
            "  `path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '路径',\n" +
            "  `type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '类型',\n" +
            "  `size` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '大小',\n" +
            "  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期',\n" +
            "  `deleted` bit(1) NULL DEFAULT NULL COMMENT '是否删除 1正常 0删除',\n" +
            "  `tenant_id` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '租户id',\n" +
            "  PRIMARY KEY (`id`) USING BTREE\n" +
            ") ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '本地存储' ROW_FORMAT = COMPACT";
    public static final String INIT_SQL_USER = "CREATE TABLE `fw_user`  (\n" +
            "  `id` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'ID',\n" +
            "  `dept_id` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '部门id',\n" +
            "  `dept_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '部门名称',\n" +
            "  `user_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户名',\n" +
            "  `nick_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '昵称',\n" +
            "  `phone` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '手机号码',\n" +
            "  `email` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '邮箱',\n" +
            "  `password` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '密码',\n" +
            "  `deleted` bit(1) NULL DEFAULT NULL COMMENT '是否删除 1正常 0删除',\n" +
            "  `enabled` bit(1) NULL DEFAULT NULL COMMENT '状态：1启用、0禁用',\n" +
            "  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期',\n" +
            "  `update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改日期',\n" +
            "  `salt` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '密码盐',\n" +
            "  `type` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '0 平台用户  1租户用户',\n" +
            "  `multiple_db` bit(1) NULL DEFAULT NULL COMMENT '是否多数据源租户',\n" +
            "  PRIMARY KEY (`id`) USING BTREE\n" +
            ") ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统用户' ROW_FORMAT = COMPACT";
    public static final String INIT_SQL_USERS_ROLES = "CREATE TABLE `fw_users_roles`  (\n" +
            "  `user_id` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户ID',\n" +
            "  `role_id` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '角色ID',\n" +
            "  PRIMARY KEY (`user_id`, `role_id`) USING BTREE,\n" +
            "  INDEX `FKq4eq273l04bpu4efj0jd0jb98`(`role_id`) USING BTREE\n" +
            ") ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户角色关联' ROW_FORMAT = COMPACT";
    public static final String INIT_SQL_DEPT_VALUE = "INSERT INTO `fw_dept` VALUES ('000cb7853c03a2d872b86f4219ed0e1c', '0', '默认部门', '2020-08-23 17:28:25', '2020-08-23 17:29:01', '";

    public static final String INIT_SQL_DIC_VALUE1 = "INSERT INTO `fw_dic` VALUES ('4a72434d2734e07ae80b771624bafd40', 'type', '菜单类型', NULL, '2020-12-03 12:52:55', NULL, '";
    public static final String INIT_SQL_DIC_VALUE2 = "INSERT INTO `fw_dic` VALUES ('645febc69d441e46db260a61c09b347b', 'logType', '日志类型', '日志类型', '2021-02-04 17:33:41', NULL, '";
    public static final String INIT_SQL_DIC_VALUE3 = "INSERT INTO `fw_dic` VALUES ('4a4b5f86c02dc843c43a9c68f7f817c0', 'language', '语言', NULL, NULL, NULL, '";
    public static final String INIT_SQL_ROLE_VALUE = "INSERT INTO `fw_role` VALUES ('0ca8c48ae5c63bf66703e56535a241e5', '超级管理员', '超级管理员', '2020-07-19 10:40:11', '";
    public static final String INIT_SQL_MENU_NAME = "CREATE TABLE `fw_menu_name`  (\n" +
            "  `id` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'ID',\n" +
            "  `menu_id` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '上级菜单ID',\n" +
            "  `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '菜单标题',\n" +
            "  `language` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '语言类型',\n" +
            "  PRIMARY KEY (`id`) USING BTREE,\n" +
            "  INDEX `inx_pid`(`menu_id`) USING BTREE,\n" +
            "  INDEX `uniq_title`(`name`) USING BTREE\n" +
            ") ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统菜单' ROW_FORMAT = COMPACT";
}
